package org.jb.coinche.client.gui.user;

import org.jb.coinche.client.user.LoginPanel;

import com.google.inject.Singleton;

@Singleton
public class LoginPanelImpl implements LoginPanel {


	@Override
	public void failed() {
		if (dialog != null)
			dialog.failed();
	}

	@Override
	public void hide() {
		dialog.hide();
		dialog = null;
	}

	@Override
	public void setListener(LoginPanelListener listener) {
		this.listener = listener;
	}

	@Override
	public void show() {
		if (dialog == null) {
			dialog = new LoginDialog(listener);
		}
		
		dialog.show();
	}
	
	private LoginPanelListener listener;
	private LoginDialog dialog;

}
